package ObjectsPlus;

import java.util.ArrayList;
//测试"获得集合中最大学生年龄"的测试类
public class TeatDemo2 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();

        Student stu1 = new Student("zhangsan", 18, "男");
        Student stu2 = new Student("lisi", 21, "女");
        Student stu3 = new Student("wangwu", 20, "男");

        list.add(stu1);
        list.add(stu2);
        list.add(stu3);

        int maxStudentAge = GetMaxNumber.getMaxAge(list);
        System.out.println(maxStudentAge);
    }
}
